<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;

class PasswordController extends Controller
{
    public function update(Request $request)
    {
        // TODO:验证旧密码
        request()->user()->update(['password' => Hash::make(request('new_password'))]);
        return response()->json(['status' => true, 'message' => 'Password updated']);
    }
}
